﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dimeng.ArdisPostProcessor.HomagLC4.Ardis
{
    public class ExternCut : ReadR41.Cut
    {
        public CutType CutType { get; set; }
        public int Counter { get; set; }
        public int ParentCounter { get; set; }
        public bool IsTrimSawCut { get; set; }

        public ExternCut()
        {

        }

        public ExternCut(ReadR41.Cut cut)
            : this()
        {
            this.CutD = cut.CutD;
            this.CutLevel = cut.CutLevel;
            this.CutParentNo = cut.CutParentNo;
            this.CutPatternNo = cut.CutPatternNo;

            this.Kerf = cut.Kerf;

            this.CutQty = 1;
            IsTrimSawCut = false;
        }

        public ExternCut(ReadR41.Cut cut, bool IsCopied)
            : this(cut)
        {
            if (IsCopied)
            {
                this.CutW = cut.CutW;
                this.CutNo = cut.CutNo;
                this.CutPartNo = cut.CutPartNo;
                //仅作一个基本判断，实际情况再修改
                if (cut.CutPartNo > 0)
                    this.CutType = CutType.Part;
                else this.CutType = CutType.Strip;
            }
        }

        public override string ToString()
        {
            return string.Format("ParentNo:{0}/CutNo:{1}/CutLevel:{2}/CutType:{3}",this.CutParentNo,this.CutNo,this.CutLevel,this.CutType);
        }
    }
}
